package org.rain.common.util.json.status;

import org.rain.common.util.json.AbsJsonState;
import org.rain.common.util.json.JsonFsm;

/**
 * created by yangtong on 2025/4/14 22:41:56
 * <br/>
 * 表示key读取完毕，准备读取用于分割键值对的冒号":"
 */
public class ExpectColonState extends AbsJsonState {
    @Override
    public void handleNonWhitespace(JsonFsm fsm, char c) {
        if (c == ':') {
            //遇到期待的的':'，就将状态切换到EXPECT_VALUE，表示准备读取value
            fsm.changeState(EXPECT_VALUE);
            return;
        }
        throw new RuntimeException("意料之外的字符，期望读到【:】，实际读到【" + c + "】");
    }
}
